package com.tank.jdk8.stream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

/**
 * Created with IntelliJ IDEA.
 * User: SuQiEr
 * Date:2017/1/29
 * Time: 20:04
 * To change this template use File | Settings | File Templates.
 */
public class StreamTest5 {

    public static void main(String[] args) {

        List<String> list = Arrays.asList("hello","world","nimei");

        Stream<String> stringStream = list.stream().map((String item) -> {
            String newStr = item.substring(0, 1).toUpperCase() + item.substring(1);
            System.out.println("test");
            return newStr;
        });
        //未调用关闭流或则求值时，流中间操作未执行
        stringStream.forEach(System.out::println);

    }
}

